package com.pubinfo.passbook.engine.cell.hook;

import com.pubinfo.passbook.common.model.http.engine.ComputeParamSlot;
import com.pubinfo.passbook.engine.cell.ComputeUnit;
import com.pubinfo.passbook.engine.constants.ComputeUnitType;

import java.util.Arrays;
import java.util.Collection;

/**
 * @author zhouch
 * @date 2021/12/20 8:17
 */
public abstract class ComputeHookUnit<T, R> extends ComputeUnit<T, R> {

    public abstract void callback(T data, R result);
  
  @Override
  public R compute(T data, R result) {
    callback(data, result);
    return result;
  }

    @Override
    public String getUnitType() {
        return ComputeUnitType.HOOK;
    }

    @Override
    public Collection<ComputeParamSlot> getParamSlots() {
        return Arrays.asList();
    }
}
